home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Ham⁄GPS / SoftKiss.src.1.8 Folder / SoftKiss.src.1.8 / core / 8530.h next >
Text File  |  1993-03-12  |  8KB  |  237 lines

  1. #ifndef    _8530_H
  2. #define    _8530_H
  3.  
  4. #ifndef SFK_SOFTKISS
  5. #ifndef    _GLOBAL_H
  6. #include "global.h"
  7. #endif
  8.  
  9. /* In 8530.asm: */
  10. void write_scc __ARGS((int16 ctl,int16 reg,int16 val));
  11. char read_scc __ARGS((int16 ctl,int reg));
  12. int rx8530 __ARGS((int16 ctl,int16 data,char *buf,int16 bufsize));
  13. #endif
  14.  
  15. /* 8530 Serial Communications Controller Register definitions */
  16. #define    FLAG    0x7e
  17.  
  18. /* Write Register 0 */
  19. #define    R0    0        /* Register selects */
  20. #define    R1    1
  21. #define    R2    2
  22. #define    R3    3
  23. #define    R4    4
  24. #define    R5    5
  25. #define    R6    6
  26. #define    R7    7
  27. #define    R8    8
  28. #define    R9    9
  29. #define    R10    10
  30. #define    R11    11
  31. #define    R12    12
  32. #define    R13    13
  33. #define    R14    14
  34. #define    R15    15
  35.  
  36. #define    NULLCODE    0    /* Null Code */
  37. #define    POINT_HIGH    0x8    /* Select upper half of registers */
  38. #define    RES_EXT_INT    0x10    /* Reset Ext. Status Interrupts */
  39. #define    SEND_ABORT    0x18    /* HDLC Abort */
  40. #define    RES_RxINT_FC    0x20    /* Reset RxINT on First Character */
  41. #define    RES_Tx_P    0x28    /* Reset TxINT Pending */
  42. #define    ERR_RES        0x30    /* Error Reset */
  43. #define    RES_H_IUS    0x38    /* Reset highest IUS */
  44.  
  45. #define    RES_Rx_CRC    0x40    /* Reset Rx CRC Checker */
  46. #define    RES_Tx_CRC    0x80    /* Reset Tx CRC Checker */
  47. #define    RES_EOM_L    0xC0    /* Reset EOM latch */
  48.  
  49. /* Write Register 1 */
  50.  
  51. #define    EXT_INT_ENAB    0x1    /* Ext Int Enable */
  52. #define    TxINT_ENAB    0x2    /* Tx Int Enable */
  53. #define    PAR_SPEC    0x4    /* Parity is special condition */
  54.  
  55. #define    RxINT_DISAB    0    /* Rx Int Disable */
  56. #define    RxINT_FCERR    0x8    /* Rx Int on First Character Only or Error */
  57. #define    INT_ALL_Rx    0x10    /* Int on all Rx Characters or error */
  58. #define    INT_ERR_Rx    0x18    /* Int on error only */
  59.  
  60. #define    WT_RDY_RT    0x20    /* Wait/Ready on R/T */
  61. #define    WT_FN_RDYFN    0x40    /* Wait/FN/Ready FN */
  62. #define    WT_RDY_ENAB    0x80    /* Wait/Ready Enable */
  63.  
  64. /* Write Register #2 (Interrupt Vector) */
  65.  
  66. /* Write Register 3 */
  67.  
  68. #define    RxENABLE    0x1    /* Rx Enable */
  69. #define    SYNC_L_INH    0x2    /* Sync Character Load Inhibit */
  70. #define    ADD_SM        0x4    /* Address Search Mode (SDLC) */
  71. #define    RxCRC_ENAB    0x8    /* Rx CRC Enable */
  72. #define    ENT_HM        0x10    /* Enter Hunt Mode */
  73. #define    AUTO_ENAB    0x20    /* Auto Enables */
  74. #define    Rx5        0x0    /* Rx 5 Bits/Character */
  75. #define    Rx7        0x40    /* Rx 7 Bits/Character */
  76. #define    Rx6        0x80    /* Rx 6 Bits/Character */
  77. #define    Rx8        0xc0    /* Rx 8 Bits/Character */
  78.  
  79. /* Write Register 4 */
  80.  
  81. #define    PAR_ENA        0x1    /* Parity Enable */
  82. #define    PAR_EVEN    0x2    /* Parity Even/Odd* */
  83.  
  84. #define    SYNC_ENAB    0    /* Sync Modes Enable */
  85. #define    SB1        0x4    /* 1 stop bit/char */
  86. #define    SB15        0x8    /* 1.5 stop bits/char */
  87. #define    SB2        0xc    /* 2 stop bits/char */
  88.  
  89. #define    MONSYNC        0    /* 8 Bit Sync character */
  90. #define    BISYNC        0x10    /* 16 bit sync character */
  91. #define    SDLC        0x20    /* SDLC Mode (01111110 Sync Flag) */
  92. #define    EXTSYNC        0x30    /* External Sync Mode */
  93.  
  94. #define    X1CLK        0x0    /* x1 clock mode */
  95. #define    X16CLK        0x40    /* x16 clock mode */
  96. #define    X32CLK        0x80    /* x32 clock mode */
  97. #define    X64CLK        0xC0    /* x64 clock mode */
  98.  
  99. /* Write Register 5 */
  100.  
  101. #define    TxCRC_ENAB    0x1    /* Tx CRC Enable */
  102. #define    RTS        0x2    /* RTS */
  103. #define    SDLC_CRC    0x4    /* SDLC/CRC-16 */
  104. #define    TxENAB        0x8    /* Tx Enable */
  105. #define    SND_BRK        0x10    /* Send Break */
  106. #define    Tx5        0x0    /* Tx 5 bits (or less)/character */
  107. #define    Tx7        0x20    /* Tx 7 bits/character */
  108. #define    Tx6        0x40    /* Tx 6 bits/character */
  109. #define    Tx8        0x60    /* Tx 8 bits/character */
  110. #define    DTR        0x80    /* DTR */
  111.  
  112. /* Write Register 6 (Sync bits 0-7/SDLC Address Field) */
  113.  
  114. /* Write Register 7 (Sync bits 8-15/SDLC 01111110) */
  115.  
  116. /* Write Register 8 (transmit buffer) */
  117.  
  118. /* Write Register 9 (Master interrupt control) */
  119. #define    VIS    1    /* Vector Includes Status */
  120. #define    NV    2    /* No Vector */
  121. #define    DLC    4    /* Disable Lower Chain */
  122. #define    MIE    8    /* Master Interrupt Enable */
  123. #define    STATHI    0x10    /* Status high */
  124. #define    NORESET    0    /* No reset on write to R9 */
  125. #define    CHRB    0x40    /* Reset channel B */
  126. #define    CHRA    0x80    /* Reset channel A */
  127. #define    FHWRES    0xc0    /* Force hardware reset */
  128.  
  129. /* Write Register 10 (misc control bits) */
  130. #define    BIT6    1    /* 6 bit/8bit sync */
  131. #define    LOOPMODE 2    /* SDLC Loop mode */
  132. #define    ABUNDER    4    /* Abort/flag on SDLC xmit underrun */
  133. #define    MARKIDLE 8    /* Mark/flag on idle */
  134. #define    GAOP    0x10    /* Go active on poll */
  135. #define    NRZ    0    /* NRZ mode */
  136. #define    NRZI    0x20    /* NRZI mode */
  137. #define    FM1    0x40    /* FM1 (transition = 1) */
  138. #define    FM0    0x60    /* FM0 (transition = 0) */
  139. #define    CRCPS    0x80    /* CRC Preset I/O */
  140.  
  141. /* Write Register 11 (Clock Mode control) */
  142. #define    TRxCXT    0    /* TRxC = Xtal output */
  143. #define    TRxCTC    1    /* TRxC = Transmit clock */
  144. #define    TRxCBR    2    /* TRxC = BR Generator Output */
  145. #define    TRxCDP    3    /* TRxC = DPLL output */
  146. #define    TRxCOI    4    /* TRxC O/I */
  147. #define    TCRTxCP    0    /* Transmit clock = RTxC pin */
  148. #define    TCTRxCP    8    /* Transmit clock = TRxC pin */
  149. #define    TCBR    0x10    /* Transmit clock = BR Generator output */
  150. #define    TCDPLL    0x18    /* Transmit clock = DPLL output */
  151. #define    RCRTxCP    0    /* Receive clock = RTxC pin */
  152. #define    RCTRxCP    0x20    /* Receive clock = TRxC pin */
  153. #define    RCBR    0x40    /* Receive clock = BR Generator output */
  154. #define    RCDPLL    0x60    /* Receive clock = DPLL output */
  155. #define    RTxCX    0x80    /* RTxC Xtal/No Xtal */
  156.  
  157. /* Write Register 12 (lower byte of baud rate generator time constant) */
  158.  
  159. /* Write Register 13 (upper byte of baud rate generator time constant) */
  160.  
  161. /* Write Register 14 (Misc control bits) */
  162. #define    BRENABL    1    /* Baud rate generator enable */
  163. #define    BRSRC    2    /* Baud rate generator source */
  164. #define    DTRREQ    4    /* DTR/Request function */
  165. #define    AUTOECHO 8    /* Auto Echo */
  166. #define    LOOPBAK    0x10    /* Local loopback */
  167. #define    SEARCH    0x20    /* Enter search mode */
  168. #define    RMC    0x40    /* Reset missing clock */
  169. #define    DISDPLL    0x60    /* Disable DPLL */
  170. #define    SSBR    0x80    /* Set DPLL source = BR generator */
  171. #define    SSRTxC    0xa0    /* Set DPLL source = RTxC */
  172. #define    SFMM    0xc0    /* Set FM mode */
  173. #define    SNRZI    0xe0    /* Set NRZI mode */
  174.  
  175. /* Write Register 15 (external/status interrupt control) */
  176. #define    ZCIE    2    /* Zero count IE */
  177. #define    DCDIE    8    /* DCD IE */
  178. #define    SYNCIE    0x10    /* Sync/hunt IE */
  179. #define    CTSIE    0x20    /* CTS IE */
  180. #define    TxUIE    0x40    /* Tx Underrun/EOM IE */
  181. #define    BRKIE    0x80    /* Break/Abort IE */
  182.  
  183.  
  184. /* Read Register 0 */
  185. #define    Rx_CH_AV    0x1    /* Rx Character Available */
  186. #define    ZCOUNT        0x2    /* Zero count */
  187. #define    Tx_BUF_EMP    0x4    /* Tx Buffer empty */
  188. #define    DCD        0x8    /* DCD */
  189. #define    SYNC_HUNT    0x10    /* Sync/hunt */
  190. #define    CTS        0x20    /* CTS */
  191. #define    TxEOM        0x40    /* Tx underrun */
  192. #define    BRK_ABRT    0x80    /* Break/Abort */
  193.  
  194. /* Read Register 1 */
  195. #define    ALL_SNT        0x1    /* All sent */
  196. /* Residue Data for 8 Rx bits/char programmed */
  197. #define    RES3        0x8    /* 0/3 */
  198. #define    RES4        0x4    /* 0/4 */
  199. #define    RES5        0xc    /* 0/5 */
  200. #define    RES6        0x2    /* 0/6 */
  201. #define    RES7        0xa    /* 0/7 */
  202. #define    RES8        0x6    /* 0/8 */
  203. #define    RES18        0xe    /* 1/8 */
  204. #define    RES28        0x0    /* 2/8 */
  205. /* Special Rx Condition Interrupts */
  206. #define    PAR_ERR        0x10    /* Parity error */
  207. #define    Rx_OVR        0x20    /* Rx Overrun Error */
  208. #define    CRC_ERR        0x40    /* CRC/Framing Error */
  209. #define    END_FR        0x80    /* End of Frame (SDLC) */
  210.  
  211. /* Read Register 2 (channel b only) - Interrupt vector */
  212.  
  213. /* Read Register 3 (interrupt pending register) ch a only */
  214. #define    CHBEXT    0x1        /* Channel B Ext/Stat IP */
  215. #define    CHBTxIP    0x2        /* Channel B Tx IP */
  216. #define    CHBRxIP    0x4        /* Channel B Rx IP */
  217. #define    CHAEXT    0x8        /* Channel A Ext/Stat IP */
  218. #define    CHATxIP    0x10        /* Channel A Tx IP */
  219. #define    CHARxIP    0x20        /* Channel A Rx IP */
  220.  
  221. /* Read Register 8 (receive data register) */
  222.  
  223. /* Read Register 10  (misc status bits) */
  224. #define    ONLOOP    2        /* On loop */
  225. #define    LOOPSEND 0x10        /* Loop sending */
  226. #define    CLK2MIS    0x40        /* Two clocks missing */
  227. #define    CLK1MIS    0x80        /* One clock missing */
  228.  
  229. /* Read Register 12 (lower byte of baud rate generator constant) */
  230.  
  231. /* Read Register 13 (upper byte of baud rate generator constant) */
  232.  
  233. /* Read Register 15 (value of WR 15) */
  234.  
  235.  
  236. #endif /* _8530_H */
  237.